import request from '@/utils/request';

const roleApi = {
  // 获取角色列表
  list(params) {
    return request({
      url: '/RoleManagement/list',
      method: 'get',
      params
    });
  },
  
  // 新增角色
  add(data) {
    return request({
      url: '/RoleManagement/add',
      method: 'post',
      data
    });
  },
  
  // 更新角色
  update(data) {
    return request({
      url: '/RoleManagement/update',
      method: 'put',
      data
    });
  },
  
  // 删除角色
  delete(id) {
    return request({
      url: `/RoleManagement/delete?id=${id}`,
      method: 'delete'
    });
  },
  
  // 绑定菜单
  bindMenu(data) {
    return request({
      url: '/RoleManagement/bindMenu',
      method: 'post',
      data
    });
  }
};

export default roleApi;